package com.gqb.Advice;

import java.lang.reflect.Method;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.ThrowsAdvice;
import org.springframework.stereotype.Component;
@Component("greetingBeforeAdvice")
public class GreetingBeforeAdvice implements MethodBeforeAdvice,ThrowsAdvice,AfterReturningAdvice{

	@Override
	public void before(Method method, Object[] args, Object target)
			throws Throwable {
		System.out.println("aaaaaaaaaa"+args);
	}

	@Override
	public void afterReturning(Object returnValue, Method method,
			Object[] args, Object target) throws Throwable {
		System.out.println("return aaaaaaaaaa"+args);		
	}
	
	public void afterThrowing(Method method,Object[] args,Object target,Exception e){
		System.out.println(target.getClass().getName());
	}
}
